package com.dgut.admin.controller;

import com.dgut.admin.service.StatisticsService;
import com.dgut.common.param.OrderListParam;
import com.dgut.common.utils.R;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author zyq
 * @Date 2022/4/18 12:51
 * @Description TODO
 * @Version 1.0
 **/
@RestController
@RequestMapping("/api/admin/data")
@RequiredArgsConstructor
public class StatisticsController {

    private final StatisticsService statisticsService;

    /**
     * 最近七天订单数据-柱状图数据
     */
    @GetMapping("order-seven")
    public R orderSevenData() {
        return R.ok().data(statisticsService.sevenDayOrder());
    }


    /**
     * 各类回收物重量
     */
    @GetMapping("/category-weight")
    public R categoryWeight(OrderListParam param) {
        return R.ok().data(statisticsService.categoryWeight(param));
    }




}
